import matplotlib.pyplot as plt
import numpy as np

unit_clap = [500, 500, 500, 1000, 1000, 1000, 2000, 2000, 2000]
unit_plac = [2000, 5000, 10000, 2000, 5000, 10000, 2000, 5000, 10000]
avg_tac = [23200, 25150, 28400, 45650, 47600, 50850, 90550, 92500, 95750]

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

# Construct arrays for the anchor positions of the bars.
xpos, ypos = np.meshgrid(unit_clap, unit_plac, indexing="ij")
xpos = xpos.ravel()
ypos = ypos.ravel()
zpos = np.zeros_like(xpos)

# Construct arrays with the dimensions for the bars.
dx = dy = np.ones_like(zpos) * 200  # Increase the width of the bars
dz = avg_tac * len(unit_clap)  # Repeat avg_tac to match the length of xpos and ypos

ax.bar3d(xpos, ypos, zpos, dx, dy, dz, zsort='average')

# Set labels and title
ax.set_xlabel('Unit CLAP/day [$]')
ax.set_ylabel('Unit PLAC/day [$]')
ax.set_zlabel('Avg. TAC of B.S. [$]')
ax.set_title('3D Bar Plot')

plt.show()
